﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<AdminDto>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content">
        <h1>
            创建/编辑管理员：<a href="<%=Url.Action("AdminList", "Admin")%>">&lt;&lt;返回</a></h1>
        <%
            using (Html.BeginForm("SaveAdmin", "Admin"))
            {%>
        <table class="addData">
            <caption>
                <h2>
                    编辑管理员
                </h2>
            </caption>
            <tr>
                <td class="alignR">
                    <span class="redTxt">*</span>帐号
                </td>
                <td>
                    <label>
                        <%=Html.TextBox("Source", Model.AdminName, new {Class = "textInput"})%>
                    </label>
                </td>
            </tr>
            <tr>
                <td class="alignR">
                    <span class="redTxt">*</span>角色
                </td>
                <td>
                    <label>
                        <%
                List<AdminRoleDto> roleDtos = ViewData["AdminRole"] as List<AdminRoleDto> ?? new List<AdminRoleDto>();%>
                        <select name="AdminRole">
                            <%
                foreach (AdminRoleDto roleDto in roleDtos)
                {%>
                            <option value="<%=roleDto.RoleID%>">
                                <%=roleDto.RoleName%></option>
                            <%
                }%>
                        </select>
                    </label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <label>
                        <input type="submit" name="button" id="button" value="保存" />
                    </label>
                </td>
            </tr>
        </table>
        <%
            }%>
    </div>
</asp:Content>
